home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / powerd / source / lib / chunky_lib.lha / Chunky / PutPixel.ass < prev    next >
Encoding:
Text File  |  2000-12-05  |  550 b   |  30 lines

  1. ; this function writes a coloured pixel into the chunky buffer and returns
  2. ; colour of pixel that was in these coords originaly
  3.  
  4. ; PutPixel(chunky:a0:PTR TO chunky,x:d0:LONG,y:d1:LONG,colour:d2:LONG)(LONG)
  5.  
  6.     machine    mc68020
  7.  
  8.     xdef    _PutPixel
  9.  
  10. _PutPixel
  11.     cmpa.l    #0,a0
  12.     beq.s    .finish
  13.     tst.l    d0
  14.     blt.s    .finish
  15.     tst.l    d1
  16.     blt.s    .finish
  17.     cmp.l    (a0),d0
  18.     bge.s    .finish
  19.     cmp.l    (4,a0),d1
  20.     bge.s    .finish
  21.  
  22.     movea.l    (8,a0),a1
  23.     muls.l    (a0),d1
  24.     add.l    d0,d1        ; d1 now contains position in buffer
  25.     move.b    (a1,d1.l),d0
  26.     and.l    #$ff,d0
  27.     move.b    d2,(a1,d1.l)
  28.  
  29. .finish    rts
  30.